﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Corona
{
    /// <summary>
    /// Interaction logic for TestWindow.xaml
    /// </summary>
    public partial class TestWindow : Window
    {
        public TestWindow()
        {
            InitializeComponent();
            IconCanvas.AddNewIcon();
            IconCanvas.AddNewTag();
            IconCanvas.AddNewTag();
            IconCanvas.AddNewTag();
            IconCanvas.AddNewTag();
            IconCanvas.AddNewTag();
            IconCanvas.AddNewTag();
            IconCanvas.AddNewResource();
            IconCanvas.OnSelectingEvent += new EventHandler<Corona.TagPresent.TagSelectEventArgs>(IconCanvas_OnSelectingEvent);
            IconCanvas.StartSelectEvent += new EventHandler<MouseButtonEventArgs>(IconCanvas_StartSelectEvent);
            //IconCanvas.MouseDown += new MouseButtonEventHandler(IconCanvas_MouseUp);
        }

        void IconCanvas_StartSelectEvent(object sender, MouseButtonEventArgs e)
        {
            foreach (Icon icon in IconCanvas.IconCollection)
            {
                icon.IsSelected = false;
            }
        }

        void IconCanvas_MouseUp(object sender, MouseButtonEventArgs e)
        {
            foreach (Icon icon in IconCanvas.IconCollection)
            {
                icon.IsSelected = false;
            }
        }

        void IconCanvas_OnSelectingEvent(object sender, Corona.TagPresent.TagSelectEventArgs e)
        {
            foreach (Icon icon in e.TagInfoList)
            {
                icon.IsSelected = true;
            }
        }
    }
}
